@model UpdaterManagement.Models.Enterprise

<nav aria-label="breadcrumb" class="breadcrumb-ace">
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="/">首页</a></li>
        <li class="breadcrumb-item"><a href="/Enterprise">企业管理</a></li>
        <li class="breadcrumb-item active">编辑企业</li>
    </ol>
</nav>

<div class="page-header">
    <div class="d-flex justify-content-between align-items-center">
        <div>
            <h1 class="page-title">
                <i class="bi bi-pencil text-primary me-2"></i>编辑企业
            </h1>
            <p class="page-subtitle">修改企业 <strong>@Model.Name</strong> 的信息</p>
        </div>
        <a href="/Enterprise" class="btn btn-outline-secondary">
            <i class="bi bi-arrow-left me-2"></i>返回列表
        </a>
    </div>
</div>

<div class="row">
    <div class="col-lg-8">
        <div class="card-ace">
            <div class="card-header">
                <i class="bi bi-form-check me-2"></i>企业信息
            </div>
            <div class="card-body">
                @if (!string.IsNullOrEmpty(ViewBag.Error as string))
                {
                    <div class="alert alert-danger">
                        <i class="bi bi-exclamation-circle me-2"></i>@ViewBag.Error
                    </div>
                }
                
                <partial name="_ErrorAlert" />
                
                <form method="post">
                    <input type="hidden" asp-for="Id" />
                    <input type="hidden" asp-for="CreatedTime" />
                    
                    <div class="row">
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label-ace">
                                    <i class="bi bi-code text-primary me-1"></i>企业代码
                                </label>
                                <input type="text" class="form-control form-control-ace" asp-for="Code" required />
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label-ace">
                                    <i class="bi bi-hash text-primary me-1"></i>ERP编号
                                </label>
                                <input type="text" class="form-control form-control-ace" asp-for="ErpNumber" required />
                            </div>
                        </div>
                    </div>
                    
                    <div class="row">
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label-ace">
                                    <i class="bi bi-buildings text-primary me-1"></i>企业名称
                                </label>
                                <input type="text" class="form-control form-control-ace" asp-for="Name" required />
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="mb-3">
                                <label class="form-label-ace">
                                    <i class="bi bi-person-badge text-primary me-1"></i>客户经理
                                </label>
                                <input type="text" class="form-control form-control-ace" asp-for="Manager" required />
                            </div>
                        </div>
                    </div>
                    
                    <div class="mb-3">
                        <label class="form-label-ace">
                            <i class="bi bi-chat-text text-primary me-1"></i>企业描述
                        </label>
                        <textarea class="form-control form-control-ace" asp-for="Description" rows="3"></textarea>
                    </div>
                    
                    <div class="mb-3">
                        <div class="form-check">
                            <input type="checkbox" class="form-check-input" asp-for="IsActive" />
                            <label class="form-check-label">
                                <i class="bi bi-toggle-on text-success me-1"></i>启用企业
                            </label>
                        </div>
                    </div>
                    
                    <div class="d-flex gap-2 pt-3 border-top">
                        <button type="submit" class="btn btn-ace-primary">
                            <i class="bi bi-check-circle me-2"></i>保存修改
                        </button>
                        <a href="/Enterprise" class="btn btn-outline-secondary">
                            <i class="bi bi-x-circle me-2"></i>取消
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    
    <div class="col-lg-4">
        <div class="card-ace">
            <div class="card-header">
                <i class="bi bi-clock text-info me-2"></i>企业信息
            </div>
            <div class="card-body">
                <div class="mb-0">
                    <strong class="text-muted">创建时间:</strong>
                    <br>@Model.CreatedTime.ToString("yyyy-MM-dd HH:mm:ss")
                </div>
            </div>
        </div>
    </div>
</div>